package com.example.exam.service.impl;

import com.example.exam.dao.ExamineeInfoDao;
import com.example.exam.entity.ExamineeInfo;
import com.example.exam.req.RegisterReq;
import com.example.exam.service.ExamineeInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ExamineeInfoServiceImpl implements ExamineeInfoService {

    @Resource
    private ExamineeInfoDao examineeInfoDao;

    @Override
    public ExamineeInfo loginByIDCardAndePwd(String examineeIDCard, String examineePwd) {
        return examineeInfoDao.loginByIDCardAndPwd(examineeIDCard, examineePwd);
    }

    @Override
    public int getNumByIDCard(String examineeIDCard) {
        return examineeInfoDao.getNumByIDCard(examineeIDCard);
    }

    @Override
    public void register(RegisterReq registerReq) {
        examineeInfoDao.register(registerReq);
    }

    @Override
    public void logoutByIDCard(String examineeIDCard) {
        examineeInfoDao.logoutByIDCard(examineeIDCard);
    }

    @Override
    public int getCountIDCard(String examineeIDCard) {
        return examineeInfoDao.getCountIDCard(examineeIDCard);
    }

    @Override
    public void update(RegisterReq registerReq) {
        examineeInfoDao.update(registerReq);
    }

    @Override
    public boolean updateExamineeInfo(RegisterReq registerReq) {
        return examineeInfoDao.updateExamineeInfo(registerReq);
    }

}
